package com.app.oasystem.controller;

import com.app.oasystem.service.impl.UploadService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 上传图片
 *
 * @author zhangbaobing
 * @date 2021/4/16
 */
@RestController
@RequestMapping("/upload")
public class UploadController {

    @Resource
    UploadService uploadService;

    @PostMapping("/picture")
    public Map<String, Object> uploadFile(@RequestParam("file") MultipartFile file) {
        return uploadService.uploadPicture(file);
    }

}